﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:primitives="clr-namespace:Elysium.Controls.Primitives"
                    xmlns:params="clr-namespace:Elysium.Parameters">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/Themes/SharedResources.xaml"/>
    </ResourceDictionary.MergedDictionaries>

    <Style x:Key="ProgressBaseStyle" TargetType="{x:Type primitives:ProgressBase}">
        <Setter Property="params:Animation.IsEnabled" Value="{Binding RelativeSource={RelativeSource Self}, Path=IsEnabled}"/>
        <Setter Property="params:Animation.Type" Value="Slide"/>
        <Style.Triggers>
            <Trigger Property="State" Value="Normal">
                <Setter Property="params:Animation.Supported" Value="None,Slide"/>
            </Trigger>
            <Trigger Property="State" Value="Indeterminate">
                <Setter Property="params:Animation.Supported" Value="Slide"/>
            </Trigger>
            <Trigger Property="State" Value="Busy">
                <Setter Property="params:Animation.Supported" Value="Slide"/>
            </Trigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="State" Value="Indeterminate"/>
                    <Condition Property="params:Animation.Type" Value="Slide"/>
                </MultiTrigger.Conditions>
                <MultiTrigger.Setters>
                    <Setter Property="params:Animation.Animation" Value="{Binding RelativeSource={RelativeSource Self}, Path=IndeterminateAnimation}"/>
                </MultiTrigger.Setters>
            </MultiTrigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="State" Value="Busy"/>
                    <Condition Property="params:Animation.Type" Value="Slide"/>
                </MultiTrigger.Conditions>
                <MultiTrigger.Setters>
                    <Setter Property="params:Animation.Animation" Value="{Binding RelativeSource={RelativeSource Self}, Path=BusyAnimation}"/>
                </MultiTrigger.Setters>
            </MultiTrigger>
        </Style.Triggers>
    </Style>
</ResourceDictionary>